<template>
  <!--  3. 给swiper设置高度 -->
  <swiper :style="{ height }" class="carousel" autoplay indicator-dots circular>
    <swiper-item v-for="item in list" :key="item.id">
      <image :src="item.imgUrl" />
    </swiper-item>
  </swiper>
</template>

<script>
export default {
  props: {
    list: Array,
    // 2. 去子组件的props属性中，接收height
    height: String,
  },
};
</script>

<style scoped>
.carousel {
  height: 100%;
}
</style>
